-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade CallbackFunction default runtime to Node 20.x #4348
Conversation
Does the PR have any schema changes?Looking good! No breaking changes found. Maintainer note: consult the runbook for dealing with any breaking changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just 1 suggestion
sdk/nodejs/lambda/lambdaMixins.ts
Outdated
const functionArgs = { | ||
...args, | ||
code: code, | ||
handler: serializedFileNameNoExtension + "." + handlerName, | ||
runtime: args.runtime || Runtime.NodeJS16dX, | ||
runtime: args.runtime || Runtime.NodeJS18dX, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we take the opportunity to just upgrade to 20x?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, #4134 was suggesting 18 as the current LTS but https://endoflife.date/nodejs suggests 20 is the current LTS so that should be reasonable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though it's a breaking change I think not doing it would be a greater issue for our users.
Function creates using node 16 will be blocked on Feb 28, 2025 and updates will be blocked on Mar 31, 2025.
We should really directly upgrade to node 20 though. The node 18 runtime is still using AL2 under the hood (see AWS docs) which will be deprecated in June 2025. There's a high chance they'll deprecate Node 18 as well in the near future.
We should mark the Node 16.x runtime as deprecated as well: https://github.com/pulumi/pulumi-aws/blob/master/provider/resources.go#L4541 |
@@ -406,13 +406,11 @@ export class CallbackFunction<E, R> extends LambdaFunction { | |||
// Copy over all option values into the function args. Then overwrite anything we care |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't put the comment on that line because it's outside of the PR, but we should also update the docs to reflect the new default:
pulumi-aws/sdk/nodejs/lambda/lambdaMixins.ts
Line 227 in 7461d68
* The Lambda runtime to use. If not provided, will default to [NodeJS8d10Runtime] |
Seems like that docstring is outdated anyways right now :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
PTAL @flostadler addressed the feedback.
I suspect just a slightly unexpected upgrade. Just calling it out for the release notes, still doing a minor release on this. Some more discussion on this in #4134 |
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@pulumi/aws](https://pulumi.io) ([source](https://togithub.com/pulumi/pulumi-aws)) | dependencies | minor | [`6.48.0` -> `6.49.0`](https://renovatebot.com/diffs/npm/@pulumi%2faws/6.48.0/6.49.0) | --- ### Release Notes <details> <summary>pulumi/pulumi-aws (@​pulumi/aws)</summary> ### [`v6.49.0`](https://togithub.com/pulumi/pulumi-aws/releases/tag/v6.49.0) [Compare Source](https://togithub.com/pulumi/pulumi-aws/compare/v6.48.0...v6.49.0) ##### Does the PR have any schema changes? Looking good! No breaking changes found. ##### New resources: - `ebs/snapshotBlockPublicAccess.SnapshotBlockPublicAccess` - `lambda/callbackFunction.CallbackFunction` - `rds/integration.Integration` ##### New functions: - `rds/getClusterParameterGroup.getClusterParameterGroup` - `secretsmanager/getSecretVersions.getSecretVersions` ##### What's Changed - Update GitHub Actions workflows. by [@​pulumi-bot](https://togithub.com/pulumi-bot) in [https://github.com/pulumi/pulumi-aws/pull/4353](https://togithub.com/pulumi/pulumi-aws/pull/4353) - Upgrade CallbackFunction default runtime to Node 20.x by [@​t0yv0](https://togithub.com/t0yv0) in [https://github.com/pulumi/pulumi-aws/pull/4348](https://togithub.com/pulumi/pulumi-aws/pull/4348) - Schematize lambda.CallbackFunction overlay and add docs for it by [@​flostadler](https://togithub.com/flostadler) in [https://github.com/pulumi/pulumi-aws/pull/4352](https://togithub.com/pulumi/pulumi-aws/pull/4352) - Upgrade terraform-provider-aws to v5.62.0 by [@​flostadler](https://togithub.com/flostadler) in [https://github.com/pulumi/pulumi-aws/pull/4359](https://togithub.com/pulumi/pulumi-aws/pull/4359) **Full Changelog**: pulumi/pulumi-aws@v6.48.0...v6.49.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNS4yIiwidXBkYXRlZEluVmVyIjoiMzguMjUuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsidHlwZS9taW5vciJdfQ==--> Co-authored-by: lumiere-bot[bot] <98047013+lumiere-bot[bot]@users.noreply.github.com>
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@pulumi/aws](https://pulumi.io) ([source](https://togithub.com/pulumi/pulumi-aws)) | dependencies | minor | [`6.48.0` -> `6.49.0`](https://renovatebot.com/diffs/npm/@pulumi%2faws/6.48.0/6.49.0) | --- ### Release Notes <details> <summary>pulumi/pulumi-aws (@​pulumi/aws)</summary> ### [`v6.49.0`](https://togithub.com/pulumi/pulumi-aws/releases/tag/v6.49.0) [Compare Source](https://togithub.com/pulumi/pulumi-aws/compare/v6.48.0...v6.49.0) ##### Does the PR have any schema changes? Looking good! No breaking changes found. ##### New resources: - `ebs/snapshotBlockPublicAccess.SnapshotBlockPublicAccess` - `lambda/callbackFunction.CallbackFunction` - `rds/integration.Integration` ##### New functions: - `rds/getClusterParameterGroup.getClusterParameterGroup` - `secretsmanager/getSecretVersions.getSecretVersions` ##### What's Changed - Update GitHub Actions workflows. by [@​pulumi-bot](https://togithub.com/pulumi-bot) in [https://github.com/pulumi/pulumi-aws/pull/4353](https://togithub.com/pulumi/pulumi-aws/pull/4353) - Upgrade CallbackFunction default runtime to Node 20.x by [@​t0yv0](https://togithub.com/t0yv0) in [https://github.com/pulumi/pulumi-aws/pull/4348](https://togithub.com/pulumi/pulumi-aws/pull/4348) - Schematize lambda.CallbackFunction overlay and add docs for it by [@​flostadler](https://togithub.com/flostadler) in [https://github.com/pulumi/pulumi-aws/pull/4352](https://togithub.com/pulumi/pulumi-aws/pull/4352) - Upgrade terraform-provider-aws to v5.62.0 by [@​flostadler](https://togithub.com/flostadler) in [https://github.com/pulumi/pulumi-aws/pull/4359](https://togithub.com/pulumi/pulumi-aws/pull/4359) **Full Changelog**: pulumi/pulumi-aws@v6.48.0...v6.49.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNS4yIiwidXBkYXRlZEluVmVyIjoiMzguMjUuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsidHlwZS9taW5vciJdfQ==--> Co-authored-by: lumiere-bot[bot] <98047013+lumiere-bot[bot]@users.noreply.github.com>
This PR has been shipped in release v6.49.0. |
This is a breaking change for users of Node automatically provisioned lambdas, moving them from the Node 16.x to Node 20.x runtime without an ability to opt out.
Prior to this change, Lambda functions provisioned in Node with CallbackFunction and helper methods such as Bucket.onObjectRemoved, Bucket.onObjectCreated or sns.Topic.onEvent used Node 16.x runtime by default. Per lambda-runtimes.html this is now deprecated by AWS. After the change, the new default runtime is Node 20.x.
Fixes #4134
The change is supported by strengthening a test to utilize
fetch()
API that was made available in 18.x and exercise the callback function at runtime.